﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;

namespace SystemModule
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class TBatterPulse // 经络
    {
        public byte Pulse;
        public byte PulseLevel;

        public TBatterPulse(byte[] buff)
        {
            this.Pulse = buff[0];
            this.PulseLevel = buff[1];
        }

        public byte[] ToByte()
        {
            using (var memoryStream = new MemoryStream())
            {
                var backingStream = new BinaryWriter(memoryStream);
                backingStream.Write(Pulse);
                backingStream.Write(PulseLevel);
                var stream = backingStream.BaseStream as MemoryStream;
                return stream.ToArray();
            }
        }
    }

}
